package com.qtu.redis_service.service.impl;

import com.qtu.redis_service.service.RedisService;
import com.qtu.redis_service.util.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RedisServiceImpl implements RedisService {

    @Autowired
    private RedisUtil redisUtil;

    @Override
    public boolean set(String key, Object value) {
        return redisUtil.set(key, value);
    }

    @Override
    public boolean set(String key, Object value, long time) {
        return redisUtil.set(key, value, time);
    }

    @Override
    public Object get(String key) {
        return redisUtil.get(key);
    }

    @Override
    public boolean exists(String key) {
        return redisUtil.hasKey(key);
    }

    @Override
    public void delete(String...key) {
        redisUtil.del(key);
    }
}
